/**
 * 创建全屏弹出按钮，并设置页面title
 * Created by djl on 2016/9/13.
 */
function initButton_Screen() {
    var href = window.location.href;
    var title = getQueryParam('title');
    if (title != null && title != '' && title != 'null' && title != document.title) {
        document.title = title;
    }
    return {
        xtype: 'button',
        text: '全屏',
        name: 'screen',
        icon: '/report/image/sysbutton/fullscreen.png',
        handler: function () {
            window.open(href);
        }
    };
}
/**
 * 创建添加常用功能按钮
 * @returns {{xtype: string, text: string, name: string, icon: string, handler: handler}}
 */
function initButton_OftenUsed() {
    var menucode = getQueryParam('menucode');
    return {
        xtype: 'button',
        text: '常用',
        name: 'oftenUsed',
        icon: '/report/image/sysbutton/projectnew.png',
        handler: function () {
            $.post("/report/third-api/saveOftenUsed", {
                MENUCODE: menucode
            }, function (jsonData) {
                var data = JSON.parse(jsonData.data);
                if (data.success) {
                    Ext.MessageBox.alert('提示', '常用设置成功！');
                } else {
                    Ext.MessageBox.alert('提示', '常用设置失败！' + data.message);
                }

            }, "json");
        }
    };
}
